#coding:utf-8
__author__ = 'lib'

from flask import Flask
from flask import request

app = Flask(__name__)

@app.route('/',methods=['GET','POST'])
def hello_world():
    if request.method =='POST':
        print "Time::"+request.form.get('time')
        print "Temp:"+request.form.get('temperature')
        print "Humi:"+request.form.get('humidity')

        return 'Test POST'
    else:
        return 'Test GET'

if __name__== '__main__':
    app.run(host='0.0.0.0') #设置成可远程访问，端口号5000
